﻿@namespace MudBlazor
@using MudBlazor.Utilities
@inherits MudComponentBase

<hr @attributes="UserAttributes" class="@Classname" style="@Style"/>

@code {
#nullable enable
    protected string Classname =>
        new CssBuilder("mud-divider")
            .AddClass("mud-divider-absolute", Absolute)
            .AddClass("mud-divider-flexitem", FlexItem)
            .AddClass("mud-divider-light", Light)
            .AddClass("mud-divider-vertical", Vertical)
            .AddClass($"mud-divider-{DividerType.ToDescriptionString()}", DividerType != DividerType.FullWidth || (DividerType == DividerType.FullWidth && Vertical == false))
            .AddClass(Class)
            .Build();

    /// <summary>
    /// Sets absolute position to the component.
    /// </summary>
    [Parameter]
    [Category(CategoryTypes.Divider.Appearance)]
    public bool Absolute { get; set; }

    /// <summary>
    /// If true, a vertical divider will have the correct height when used in flex container.
    /// </summary>
    [Parameter]
    [Category(CategoryTypes.Divider.Appearance)]
    public bool FlexItem { get; set; }

    /// <summary>
    /// If true, the divider will have a lighter color.
    /// </summary>
    [Parameter]
    [Category(CategoryTypes.Divider.Appearance)]
    public bool Light { get; set; }

    /// <summary>
    /// If true, the divider is displayed vertically.
    /// </summary>
    [Parameter] 
    [Category(CategoryTypes.Divider.Appearance)]
    public bool Vertical { get; set; }

    /// <summary>
    /// The Divider type to use.
    /// </summary>
    [Parameter] 
    [Category(CategoryTypes.Divider.Appearance)]
    public DividerType DividerType { get; set; } = DividerType.FullWidth;

}